package cn.heiliu.selenium;

import cn.heiliu.selenium.config.SetupConfig;
import cn.heiliu.selenium.service.ISeleniumPoolService;
import cn.heiliu.selenium.service.IWebDriverCreateService;
import cn.heiliu.selenium.service.IWebDriverService;
import cn.heiliu.selenium.service.impl.FirefoxWebDriverCreateServiceImpl;
import cn.heiliu.selenium.service.impl.SeleniumPoolServiceImpl;

/**
 * @author wangyelou
 * @date 2021/6/14
 */
public class SeleniumManager {

    /**
     * 创建firefox管理池
     * @param setupConfig
     * @return
     */
    public static ISeleniumPoolService createFirefoxSeleniumPool(SetupConfig setupConfig) {
        return new SeleniumPoolServiceImpl(new FirefoxWebDriverCreateServiceImpl(), setupConfig);
    }

    /**
     * 生成firefox浏览器
     * @param setupConfig
     * @return
     */
    public static IWebDriverService createFirefoxSelenium(SetupConfig setupConfig) {
        IWebDriverCreateService webDriverCreateService = new FirefoxWebDriverCreateServiceImpl();
        return webDriverCreateService.createWebDriver(setupConfig);
    }


}
